package structual_pattern.bridge_pattern;

public class BridgePattern {

}
class Matrix{

}
abstract class Image{
    protected ImgImpl imp;

    public void setImp(ImgImpl imp) {
        this.imp = imp;
    }

    public abstract void parseImg();
}
interface ImgImpl{
    void doPaint(Matrix matrix);
}
class WindowImp implements ImgImpl{

    @Override
    public void doPaint(Matrix matrix) {
        System.out.println("window");
    }
}
class MacImp implements ImgImpl{
    @Override
    public void doPaint(Matrix matrix) {
        System.out.println("mac");
    }
}
class JPGImg extends Image{

    @Override
    public void parseImg() {
        super.imp.doPaint(new Matrix());
    }
}
class PNGImg extends Image{

    @Override
    public void parseImg() {
        super.imp.doPaint(new Matrix());

    }
}